package com.youle.mapper;

import com.youle.item.pojo.ItemCategory;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.common.Mapper;

import java.util.Arrays;
import java.util.List;

/**
 * Created by
 *   定义的是itemcategory的通用的mapper查询逻辑
 * @author touni
 * @date 2019/4/17
 * @time 19:15
 */

@Component
public interface ItemCategoryMapper extends Mapper<ItemCategory> {

    @Select("SELECT * FROM tb_category WHERE id IN (SELECT category_id FROM tb_category_brand WHERE brand_id = #{bid})")
    List<ItemCategory> queryBrandByBid(Long bid);

    Arrays selectByIdList(List<Long> ids);
}
